/*
 *NOTE:Auto generated dao
*/
package com.surfilter.modules.com.dao;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.surfilter.modules.com.model.ComStatModel;
import com.surfilter.modules.com.model.HtComModel;
import com.surfilter.platform.base.dao.DaoBase;
import com.surfilter.platform.base.model.PageInfo;

@Repository(value="Service_comHtComDao")
public class HtComDao extends DaoBase<HtComModel>{

	@Resource(name = "surfilterSqlMapClient")
	private SqlMapClient sqlMapClient;

	public void initSqlMapClient() {
		this.setSqlMapClient(sqlMapClient);
	}
	
		public java.lang.Integer addHtCom(HtComModel htComModel) {
		java.lang.Integer key = (java.lang.Integer) this.addObject("addHtCom", htComModel);
		return key;
	}
	
	public void chgHtCom(HtComModel htComModel) {
		this.updateObject("chgHtCom", htComModel);
	}
	
	public void delHtCom(HtComModel htComModel) {
		this.updateObject("delHtCom", htComModel);
	}

	public List<HtComModel> getHtComs(HtComModel htComModel, PageInfo pageInfo) {
		return this.getListByObjectForPage("getHtComs", htComModel, pageInfo);
	}
	
	public void delHtComs(List<java.lang.Integer> ids){
		this.deleteObject("delHtComs", ids);
	}
	
	public int getHtComsCount(HtComModel htComModel) {
		return (Integer) this.getObjectByObject("getHtComsCount", htComModel);
	}

	public HtComModel getHtComById(Integer id) {
		return (HtComModel) this.getObjectByObject("getHtComById", id);
	}

	public ComStatModel getComStat(Integer id) {
		ComStatModel model = new ComStatModel();
		model.setComId(id);
		model.setUserCount((Integer)this.getObjectByObject("getUserCountOfCom", id));
		model.setImpUserCount((Integer)this.getObjectByObject("getImpUserCountOfCom", id));
		model.setImpPosCount((Integer)this.getObjectByObject("getImpPosCountOfCom", id));
		model.setCarCount((Integer)this.getObjectByObject("getCarCountOfCom", id));
		return model;
	}

	public void chgComBasic(HtComModel htComModel) {
		this.updateObject("updateBasicCom", htComModel);
	}

	public void chgComInfo(HtComModel htComModel) {
		this.updateObject("updateComInfo", htComModel);
	}
}
